package otherapi.itext.kernellayoutpdf;

import com.itextpdf.layout.Document;
import otherapi.itext.DocumentPropertyConst;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 1/10/2023 8:23 AM
 */
public final class ItextKernelUtils {

    /**
     * 10 列的单元格
     */
    public static final float[] TABLE_PROPORTION = {0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f};
    public static final float MARGIN_FIVE = 5.0f;

    private ItextKernelUtils() {
    }

    /**
     * 设置当前打印页可用高度
     *
     * @param document document
     * @param height   height
     */
    public static void setDocumentAvailableHeight(Document document, float height) {
        document.setProperty(DocumentPropertyConst.AVAILABLE_HEIGHT, height);
    }

    /**
     * 获取文档实际高度
     *
     * @param document document
     * @return float
     */
    public static float getDocumentAvailableHeight(Document document) {
        return document.getProperty(DocumentPropertyConst.AVAILABLE_HEIGHT);
    }
}
